



class Solution:

    def maxArea(self, height):

        if not height or len(height) == 1:
            return 0

        i, j = 0, len(height) - 1
        maxA = 0
        while(i < j):

            maxA = max(maxA, min(height[i], height[j]) * (j - i))

            if height[i] > height[j]:
                j -= 1
            else:
                i += 1
        
        return maxA